#ifndef _SQL_
#define _SQL_

#include<string>
#include"mysql/mysql.h"
using std::string;

struct MysqlConnectInfo {
   MYSQL* mysql;
   char host[256];
   char user[256];
   char password[256];
   char db[256];
   unsigned int port;
   char *unix_socket;
   unsigned long client_flag;
};
using  MysqlConnectInfo = struct  MysqlConnectInfo;


class DataBase
{
public:
    DataBase(string tablename);
    ~DataBase();
    DataBase(const DataBase&) = delete;
    DataBase& operator=(const DataBase&) = delete;

    //bool InquireDatabases(string DBname);
    //bool CreateDatabases(string DBname);

    bool InquireTable(string tableName);
    bool CreateTable(string tableName);
    bool InsertData(string tableName,int id,string name);

private:
    int MysqlInfoInit(MysqlConnectInfo* mysqlconnectInfo,MYSQL *mysql);

private:
    string TableName;
    MYSQL* sqlObj;
};


#endif